from dfa import core, simulator, parser

dfa = core.DFA(name="myDFA")
dfa.add_state("a")
dfa.add_state("b")
dfa.add_state("c")
dfa.add_state("d")
dfa.add_state("e")
dfa.add_state("f")

dfa.add_transition("a", "b", "0", "1")
dfa.add_transition("a", "d", "1", "0")

# 2-cycle with b,c
dfa.add_transition("b", "c", "0", "1")
dfa.add_transition("b", "c", "1", "0")
dfa.add_transition("c", "b", "0", "0")
dfa.add_transition("c", "b", "1", "1")

# 3-cycle with d,e,f
dfa.add_transition("d", "e", "0", "0")
dfa.add_transition("d", "e", "1", "1")
dfa.add_transition("e", "f", "0", "1")
dfa.add_transition("e", "f", "1", "0")
dfa.add_transition("f", "d", "0", "0")
dfa.add_transition("f", "d", "1", "1")

dfa.set_init("a")
sim = simulator.Simulator(dfa)
print sim.print_cycle_func()
#print parser.write_dot(dfa)
